package com.ruoyi.manage.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.manage.mapper.AttOvertimeMapper;
import com.ruoyi.manage.domain.AttOvertime;
import com.ruoyi.manage.service.IAttOvertimeService;

/**
 * 员工加班记录Service业务层处理
 * 
 * @author cf
 * @date 2025-06-04
 */
@Service
public class AttOvertimeServiceImpl implements IAttOvertimeService 
{
    @Autowired
    private AttOvertimeMapper attOvertimeMapper;

    /**
     * 查询员工加班记录
     * 
     * @param id 员工加班记录主键
     * @return 员工加班记录
     */
    @Override
    public AttOvertime selectAttOvertimeById(Long id)
    {
        return attOvertimeMapper.selectAttOvertimeById(id);
    }

    /**
     * 查询员工加班记录列表
     * 
     * @param attOvertime 员工加班记录
     * @return 员工加班记录
     */
    @Override
    public List<AttOvertime> selectAttOvertimeList(AttOvertime attOvertime)
    {
        return attOvertimeMapper.selectAttOvertimeList(attOvertime);
    }

    /**
     * 新增员工加班记录
     * 
     * @param attOvertime 员工加班记录
     * @return 结果
     */
    @Override
    public int insertAttOvertime(AttOvertime attOvertime)
    {
        attOvertime.setCreateTime(DateUtils.getNowDate());
        return attOvertimeMapper.insertAttOvertime(attOvertime);
    }

    /**
     * 修改员工加班记录
     * 
     * @param attOvertime 员工加班记录
     * @return 结果
     */
    @Override
    public int updateAttOvertime(AttOvertime attOvertime)
    {
        attOvertime.setUpdateTime(DateUtils.getNowDate());
        return attOvertimeMapper.updateAttOvertime(attOvertime);
    }

    /**
     * 批量删除员工加班记录
     * 
     * @param ids 需要删除的员工加班记录主键
     * @return 结果
     */
    @Override
    public int deleteAttOvertimeByIds(Long[] ids)
    {
        return attOvertimeMapper.deleteAttOvertimeByIds(ids);
    }

    /**
     * 删除员工加班记录信息
     * 
     * @param id 员工加班记录主键
     * @return 结果
     */
    @Override
    public int deleteAttOvertimeById(Long id)
    {
        return attOvertimeMapper.deleteAttOvertimeById(id);
    }
}
